Monitoring SMTP Virtual Servers
There are several ways to
monitor your SMTP virtual servers once they are properly configured. IIS
6.0 Manager provides the Current Sessions item to view all current
connections to the SMTP server. If you are experiencing delays in
message transmissions or performance problems on the server, you can use
this information to determine the source of messaging traffic.
You
can also monitor many Windows Performance Monitor counters that are
part of the SMTP Server object. Some useful counters for monitoring SMTP
server usage include:
In addition to monitoring
usage of the server, you should check periodically for undeliverable
messages. By default, these messages will be stored within the root
folder that was defined for the SMTP server. The default SMTP Virtual
Server #1 uses the %SystemDrive%\Inetpub\Mailroot folder. With this folder are several subfolders that can include message details:
Badmail Messages that are undeliverable due to addressing or security issues
Drop Storage of all incoming SMTP messages
Pickup Storage of messages that are waiting to be processed by another program or service
Queue Messages that are awaiting delivery
Additionally,
if you have configured undeliverable messages to be forwarded to a
specific account, you should review those messages periodically.
Using an SMTP Virtual Server
SMTP virtual servers
can be accessed in several ways. Systems administrators can use the
Telnet command-line utility to connect to an SMTP server directly and
send commands or create messages. In general use, however, the most
typical sources of SMTP messages are end-user applications and Web
applications.
Using Telnet
You can connect to an SMTP server directly by using the Telnet
command. The Telnet Client is an optional Windows Server 2008 feature
that can be added to the computer. Once you have added this feature to
the computer, you can use the Telnet command from a command prompt to
connect to an SMTP virtual server. You can then type manual commands to
carry out actions such as sending a new message. Generally, Telnet is
used only for diagnostic and troubleshooting purposes. End users will most likely rely upon user-friendly applications to send and receive e-mail messages.
More Info: Troubleshooting with Telnet
For more
information about troubleshooting SMTP by using Telnet, see the
Microsoft Help and Support article entitled “How To Test SMTP Services
Manually in Windows Server 2003” at http://support.microsoft.com/kb/323350/.
Using a Client Messaging Application
For end users, the
most common method of sending e-mail messages is through a client e-mail
application. Examples include Microsoft Outlook, Windows Mail (which is
included with the Windows Vista operating system), and Outlook Express
(which is included with Windows XP). The specific setup instructions for
these applications will vary, but users will generally need the
following information to configure their SMTP servers properly:
Configuring SMTP Settings for ASP.NET
A common requirement
for many Web applications is the ability to send e-mail messages to
users. To complete this task, the Web application requires information
about an available SMTP server. You can configure these settings for an
ASP.NET application that is running on IIS 7 by using IIS Manager. To do
this, select the applicable Web server, Web site, or Web application in
the left pane, and then open the SMTP E-Mail setting. (See Figure 12.)
Web applications can be
built to query this information whenever a new e-mail message needs to
be sent, thereby reducing deployment configuration. The available
options include E-Mail Address, which is the address that will be used
in the From field for the message. The SMTP Server and Port settings
define details for connecting to an available SMTP virtual server. The
Authentication settings can be provided if the SMTP server requires
credentials to be passed. Finally, the Store E-Mail In Pickup Directory
option is an alternative to forwarding messages to an SMTP server. When
you choose this option, outbound messages will be stored as individual
files within the folder you have specified.
Practice: Configuring and Testing SMTP Services
This practice will help you practice the process of enabling SMTP services in Windows Server 2008.
▸ Exercise 1 Create a New SMTP Virtual Server
In this exercise,
you will create a new SMTP virtual server by using IIS 6.0 Manager. The
steps assume that you have not yet installed the SMTP Server feature.
1. | Log on to Server2.contoso.com as a user with Administrator permissions.
|
2. | Open Server Manager. Right-click Features, and select Add Features.
|
3. | Select the SMTP Server and Telnet Client features, and then click Next to continue.
|
4. | On
the Confirm Installation Selections page, click Install to begin the
feature installation process. When the installation process has
finished, click Close.
|
5. | Close Server Manager. Launch IIS 6.0 Manager from the Administrative Tools program group.
|
6. | Expand the Server2 (Local Computer) object, and note that a default object, SMTP Virtual Server #1, has already been created.
|
7. | Right-click the Server2 object, and select New Virtual Server.
|
8. | For the Name setting, type Contoso SMTP. Click Next.
|
9. | For
the Select IP Address setting, keep the default setting, and then click
Next. Read the warning message, and then click Yes to continue.
You will resolve this conflict in later steps.
|
10. | Using Windows Explorer, create a new folder named Mail in the root of your system drive. For the home directory, select the path to this folder (for example, C:\Mail).
|
11. | In the Domain step, type mail.contoso.com, and then click Finish. Note that a new SMTP virtual server named Contoso SMTP appears in the left pane of IIS 6.0 Manager.
|
12. | Right-click the Contoso SMTP object, and select properties.
|
13. | On
the General tab, click Advanced to open the list of IP address and port
number settings for the SMTP virtual server. Select the (All
Unassigned) entry in the list, and then click Edit.
|
14. | Change
the TCP Port setting to 2525, and then click OK. This will resolve the
conflict with the default SMTP Virtual Server. Click OK three times to
close the dialog boxes and save the settings.
|
15. | In IIS 6.0 Manager, right-click the Contoso SMTP virtual server object, and select Start.
|
16. | After
you have completed the steps of this practice exercise, you can use an
e-mail client to connect to the SMTP server and send a message. You can
attempt to send a message to a known bad e-mail address (such as [email protected]) to verify the behavior of the SMTP server.
|
17. | When you are finished, close IIS 6.0 Manager. You can optionally uninstall the SMTP server if you no longer need it on Server2. |